#include <cstdio>
#include <cstring>

char s[ 1001 ][ 1001 ];
bool ok[ 1001 ][ 1001 ];

int main( )
{
    int n, i, j, m;
    while ( scanf("%d", &n) != EOF )
    {
        memset( ok, 1, sizeof( ok ) );
        for ( i = 0; i < n; i++ )
            scanf("%s", s[ i ]);
        m = strlen( s[ 0 ] );
        for ( i = 0; i < m; i++ )
        {
            for ( j = 0; j < n; j++ )
                if ( s[ i ][ j ] == '_' )
                    ok[ i ][ j ] = false;
                else
                    break;
            if ( j < n ) break;
        }
        for ( i = m - 1; i >= 0; i-- )
        {
            for ( j = n - 1; j >= 0; j-- )
            {
                if ( !ok[ j ][ i ] ) break;
                if ( s[ j ][ i ] == '_' ) printf(" ");
                else if ( s[ j ][ i ] == '\\' ) printf("\n");
                else printf("%c", s[ j ][ i ]);
            }
            if ( j >= 0 ) break;
        }
        puts("");
        puts("");
    }
    return 0;
}
